<?xml version="1.0" encoding="windows-1251" ?>
<!DOCTYPE local [
<!ENTITY nbsp  "&#xA0;">
<!ENTITY bull  "&#x02219;">
]>
<x:stylesheet version="1.0"
	exclude-result-prefixes="atom xhtml php"
	xmlns:php="http://php.net/xsl"
	xmlns:x="http://www.w3.org/1999/XSL/Transform"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:f="http://www.w3schools.com/furniture"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:xhtml="http://www.w3.org/1999/xhtml">
<x:template match="/">
	<x:apply-templates />
</x:template>

<x:template match="/atom:feed">

<!-- nesting container -->
<div id="{$model}" style="width: 700px; clear: both; overflow: hidden; position: relative;">

	<x:for-each select="atom:entry">
	<!-- Sorting by publication date. Date format: 2009-10-15T19:52:00Z -->
	<x:sort data-type="number" order="descending" select="substring(atom:published,1,4)"/> <!-- year  -->
	<x:sort data-type="number" order="descending" select="substring(atom:published,9,2)"/> <!-- day   -->
	<x:sort data-type="number" order="descending" select="substring(atom:published,12,2)"/> <!-- hour  -->
	<x:sort data-type="number" order="descending" select="substring(atom:published,15,2)"/> <!-- minut -->

		<x:choose>
			<x:when test="atom:content/@src = $image or ($image = '' and position() = 1)">

			<!-- show photo close-up -->
				<div id="view" style="clear: both; overflow: hidden; width: 700px; position: relative; margin: 0 0 20px 0;">
					<p style="margin: 12px 0 0;">
						<img src="{atom:content/@src}" border="0" />
					</p>
					<p style="margin: 8px 0 16px;">
						<!-- x:value-of select="//atom:content[@src=$image]/parent::*/atom:title" / -->
						<x:value-of select="atom:title" />.
						<x:value-of select="$text" />
					</p>
				</div>

			</x:when>
			<x:otherwise>

				<div style="overflow: hidden; float: left; height: 136px; width: 136px; margin: 4px 4px 0 0; position: relative;">
					<a href="photos/?photo={atom:content/@src}#view" style="border:none;"><img src="{concat(substring-before(atom:content/@src,'_XL'),'_M')}" border="0" /></a>
				</div>

			</x:otherwise>
		</x:choose>
	</x:for-each>

</div>
</x:template>
</x:stylesheet>
